const goodId = window.sessionStorage.getItem('goodId')
const center = document.querySelector('.cart>.contain>.center')

getCart()
async function getCart() {
    let info = {
        itemId: `${goodId}`,
    }
    const res = await pAjax({ url: '/six', data: info, dataType: 'json' })
    bindImg(res.data.itemInfo.imgContent)
    bindInfo(res.data)
}
function bindImg(list) {
     str = ``
    list.forEach((item, index) => {
        str = `
    <input type="checkbox">
          <img src="${item}">
          `
        center.innerHTML = str
    })
}
function bindInfo(list) {
    // let str = ``
     str = `
    <p>${list.itemInfo.title}</p>
    <p>分类:${list.subItems[0].ctitle}</p>
    <p>￥${list.itemInfo.priceSale}</p>
    <div>
        <span>-</span>
        <span></span>
        <span>+</span>
    </div>
    <p>￥${list.itemInfo.priceSale}</p>
    <p>删除</p>
`
    center.innerHTML += str
}



